﻿<UserControl x:Class="InterLinq.Test.UI.ServicesView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:this="clr-namespace:InterLinq.Test.UI.Convertor">
    <Border>
        <StackPanel Orientation="Horizontal">
            <StackPanel Orientation="Vertical">
                <Label>Loaded services</Label>
                <ListBox Name="m_items" Width="350" MouseUp="m_items_MouseUp">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Vertical">
                                <StackPanel.Visibility>
                                    <Binding>
                                        <Binding.Converter>
                                            <this:IsDefaulToVisibillityConverter/>
                                        </Binding.Converter>
                                    </Binding>
                                </StackPanel.Visibility>
                                <Label  Content="{Binding ServiceName}"></Label>
                                <Label Content="{Binding FriendlyServiceName}" TextBlock.FontSize="8"></Label>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </StackPanel>
            <StackPanel Width="500">
                <StackPanel.Resources>
                    <Style x:Key="Header" TargetType="Label">
                        <Setter Property="Width" Value="250"/>
                    </Style>
                </StackPanel.Resources>
                <Label>Detail of the selected services</Label>
                <StackPanel Orientation="Horizontal">
                    <Label Style="{StaticResource Header}">Name</Label>
                    <Label Name="m_name"></Label>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label Style="{StaticResource Header}">FriendlyName</Label>
                    <Label Name="m_friendlyName"></Label>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label Style="{StaticResource Header}">Refreshed at:</Label>
                    <Label Name="m_time"></Label>
                </StackPanel>
                <StackPanel>
                    <Label Style="{StaticResource Header}" HorizontalAlignment="Left">Service dependencies</Label>
                    <ListBox Name="m_dependencies" Width="350" MinHeight="50">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <StackPanel.Visibility>
                                        <Binding>
                                            <Binding.Converter>
                                                <this:IsDefaulToVisibillityConverter/>
                                            </Binding.Converter>
                                        </Binding>
                                    </StackPanel.Visibility>
                                    <Label  Content="{Binding}" Width="200"></Label>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
                <StackPanel>
                    <Label  HorizontalAlignment="Left" Style="{StaticResource Header}">Service data</Label>
                    <ListBox Name="m_detailItems" Width="350" MinHeight="50">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <StackPanel.Visibility>
                                        <Binding>
                                            <Binding.Converter>
                                                <this:IsDefaulToVisibillityConverter/>
                                            </Binding.Converter>
                                        </Binding>
                                    </StackPanel.Visibility>
                                    <Label  Content="{Binding Key}" Width="200"></Label>
                                    <Label Content="{Binding CollectedValue}"></Label>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
            </StackPanel>
        </StackPanel>
    </Border>
</UserControl>
